import wiringpi as gpio
import time

pin = 12
v = 100
gpio.wiringPiSetupPhys()
gpio.pinMode(pin, gpio.OUTPUT)
gpio.softPwmCreate(pin, 0, v)

try:
  while True:
    for dc in range(0, v+1, 5):
      gpio.softPwmWrite(pin, dc)
      print(dc)
      time.sleep(.1)
    for dc in range(v, -1, -5):
      gpio.softPwmWrite(pin, dc)
      print(dc)
      time.sleep(.1)
except KeyboardInterrupt:
  pass

